﻿<%@page import="cn.ihuizi.util.Admin_Id"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 <base href="<%=basePath%>">
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <link type="text/css" rel="stylesheet" media="all" href="css/global.css" />
        <link type="text/css" rel="stylesheet" media="all" href="css/global_color.css" />
      	<%@ include file="../header/header_list.jsp"%>
        <script language="javascript" type="text/javascript">
          <!--   //保存成功的提示信息 -->
          function showResult() {
                showResultDiv(true);
                window.setTimeout("showResultDiv(false);", 3000);
            }
            function showResultDiv(flag) {
                var divResult = document.getElementById("save_result_info");
                if (flag)
                    divResult.style.display = "block";
                else
                    divResult.style.display = "none";
            }
        </script>
    </head>
    <body>
       
        <!--主要区域开始-->
        <div id="main">            
            <!--保存操作后的提示信息：成功或者失败-->
            <div id="save_result_info" class="save_success"><span id="show"></span></div><!--保存失败，数据并发错误！-->
            <form  class="main_form">
                <div class="text_info clearfix"><span>管理员账号：</span></div>
                <div class="input_info"><input type="text" readonly="readonly" class="readonly" value="<%=Admin_Id.account %>" /></div>
                <div class="text_info clearfix"><span>角色：</span></div>
                <div class="input_info">
                    <input type="text" readonly="readonly" class="readonly width400" value="${role}" />
                </div>
                <div class="text_info clearfix"><span>姓名：</span></div>
                <div class="input_info">
                    <input type="text" value="${name}" id="name"/>
                    <span class="required">*</span>
                    <div class="validate_msg_long error_msg">20长度以内的汉字、字母的组合</div>
                </div>
                <div class="text_info clearfix"><span>电话：</span></div>
                <div class="input_info">
                    <input type="text" class="width200" value="${phone}" id="phone"/>
                    <div class="validate_msg_medium">电话号码格式：手机或固话</div>
                </div>
                <div class="text_info clearfix"><span>Email：</span></div>
                <div class="input_info">
                    <input type="text" class="width200" value="${email}" id="email" />
                    <div class="validate_msg_medium">50长度以内，符合 email 格式</div>
                </div>
                <div class="text_info clearfix"><span>创建时间：</span></div>
                <div class="input_info"><input type="text" readonly="readonly" class="readonly" value="${time}"/></div>
                <div class="button_info clearfix">
                    <input type="submit" value="保存" class="btn_save" id="btn_save" onclick="showResult()"  />
                    <input type="button" value="取消" class="btn_save" />
                </div>
            </form>  
        </div>
        <!--主要区域结束-->
        <div id="footer">
          
        </div>
        <script src="js/jquery-3.3.1.js" type="text/javascript">
        </script>
	<script type="text/javascript">
		$(document).ready(function() { //定义最后加载   
			$("#btn_save").click(function() {
				$.ajax({
					url : 'AdminUpdateSelServlet',
					type : 'GET',
					data : {
						"name":$("#name").val(),
						"phone":$("#phone").val(),
						"email":$("#email").val()
					},
					dataType : "text",
					success : function(result) {
						$("#show").html(result);
					},
				})
				return false;
			})
		})
	</script>
</body>
    
</html>
